#@layout("用户管理")
#define main()
<body class="timo-layout-page">
    <div class="layui-card">
        <div class="layui-card-header timo-card-header">
            <span><i class="fa fa-bars"></i> 用户管理</span>
            <i class="layui-icon layui-icon-refresh refresh-btn"></i>
        </div>
        <div class="layui-card-body">
            <div class="layui-row timo-card-screen put-row">
                <div class="pull-left layui-form-pane timo-search-box">
                    <div class="layui-inline">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block timo-search-status">
                            <select class="timo-search-select" name="sysUser.status" >
                            	<option value="">选择</option>
                            	#for(item : joyDict.getDictList('status'))
                            	<option value="#(item.dictValue)" #if(item.dictValue==(sysUser.status+'')) selected="selected" #end >#(item.dictName)</option>
                            	#end
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block">
                            <input type="text" name="sysUser.userName" value="#(sysUser.userName)" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">用户昵称</label>
                        <div class="layui-input-block">
                            <input type="text" name="sysUser.nickName" value="#(sysUser.nickName)" placeholder="请输入用户昵称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn timo-search-btn">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>
                </div>
                <div class="pull-right screen-btn-group">
                    <div class="btn-group-left">
                        <button class="layui-btn open-popup-param" data-type="radio" data-title="角色分配" data-url="#(ctxAd)/user/toRole" data-size="480,400"><i class="fa fa-user-secret"></i> 角色分配</button>
                    </div>
                    <div class="btn-group-right">
                        <button class="layui-btn open-popup" data-title="添加用户" data-url="#(ctxAd)/user/add" data-size="600,520"><i class="fa fa-plus"></i>添加</button>
                        <div class="btn-group">
                            <button class="layui-btn">操作<span class="caret"></span></button>
                            <dl class="layui-nav-child layui-anim layui-anim-upbit">
                                <dd><a class="ajax-status" href="#(ctxAd)/user/status/1">启用</a></dd>
                                <dd><a class="ajax-status" href="#(ctxAd)/user/status/0">冻结</a></dd>
                            </dl>
                        </div>
                    </div>
                </div>
            </div>
            <table class="layui-table timo-table">
                <thead>
                <tr>
                    <th class="timo-table-checkbox"><label class="timo-checkbox"><input type="checkbox"><i class="layui-icon layui-icon-ok"></i></label></th>
                    <th class="sortable" data-field="userName">用户名</th>
                    <th class="sortable" data-field="nickName">用户昵称</th>
                    <th class="sortable" data-field="sex">性别</th>
                    <th class="sortable" data-field="phone">电话</th>
                    <th class="sortable" data-field="email">邮箱</th>
                    <th class="sortable" data-field="createTime">创建时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                #for(item : page.list)
	                <tr>
	                    <td><label class="timo-checkbox"><input type="checkbox" value="#(item.id)" ><i class="layui-icon layui-icon-ok"></i></label></td>
	                    <td>#(item.userName)</td>
	                    <td>#(item.nickName)</td>
	                    <td>#(joyDict.getDictLabel(item.sex+'','sex','未知'))</td>
	                    <td>#(item.phone)</td>
	                    <td>#(item.email)</td>
	                    <td>#date(item.createTime, "yyyy-MM-dd HH:mm:ss")</td>
	                    <td>#(joyDict.getDictLabel(item.status+'','status','未知'))</td>
	                    <td>
	                    	#if(item.userName != cn.joytur.common.mvc.constant.CommonAttribute::SUPER_ADMIN_NAME)
	                        <a class="open-popup" data-title="编辑用户" data-url="#(ctxAd)/user/edit?id=#(item.id)"  data-size="600,520" href="#">编辑</a>
	                        <a class="ajax-get" data-msg="您是否删除#(item.nickname)" href="#(ctxAd)/user/status/delete(ids=#(item.id))}">删除</a>
	                        #end
	                    </td>
	                </tr>
                #end
                </tbody>
            </table>
            <!-- page -->
            #include("../../common/page.html", url=pageUrl)
            <!-- page end -->
        </div>
    </div>
</body>
#end